﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>版辊单据信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/Content/X-admin/css/font.css" rel="stylesheet" />
    <link href="~/Content/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/Content/X-admin/js/jquery.min.js"></script>
    <script src="~/Content/X-admin/js/xadmin.js"></script>
    <script src="~/Content/Scripts/System/systemFrame.js"></script>
    <script src="~/Content/Scripts/layui/layui.js"></script>
    <script src="~/Content/Scripts/System/Common.js"></script>
    <link href="~/Content/Scripts/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    <span style="margin-top:15px;margin-left:15px">
        <xblock>
            <button class="layui-btn" onclick="saveData()"><i class="layui-icon"></i>保存</button>
            <button class="layui-btn" onclick="closeWin()"><i class="layui-icon">&#x1006;</i>取消</button>
        </xblock>
    </span>

    <div style="margin: 20px; border: 1px solid #dbdbdb;padding:15px">

        <form id="AddForm" class="layui-form layui-col-space5">
            <div class="layui-input-inline">
                <input type="hidden" id="businesscode" name="businesscode" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    单据类型
                </label>
                <div class="layui-input-inline">
                    <select id="businesstype" name="businesstype" class="bdjlx">
                        选择单据类型
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    日期
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="happenDate" name="happenDate" autocomplete="off" class="layui-input">
                </div>
                <label for="L_email" class="layui-form-label">
                    运输方式
                </label>
                <div class="layui-input-inline">
                    <select id="ysfs" name="ysfs" class="bysfs">
                        选择运输方式
                    </select>
                </div>
                </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    原因
                </label>
                <div class="layui-input-block">
                    <input type="text" id="memo" name="memo" required="" autocomplete="off" class="layui-input">
                </div>

            </div>

        </form>

    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        dicData("bysfs", "ysfs");
        dicData("bdjlx", "djlx");
        CommonData('ysfs', "bysfs");
        CommonData('djlx', "bdjlx");

        var dataId = getUrlVariable("dataId");
        if (dataId != "0") {
            $("input[ name='businesscode']").val(dataId);
        }
    })
    layui.use(['laydate'], function () {
        var $ = layui.$;
        var laydate = layui.laydate;
        var nowTime = new Date().valueOf();
        var max = null;
        var start = laydate.render({
            elem: '#happenDate',
            trigger: 'click',
            type: 'date',
            format: 'yyyy-MM-dd',
            btns: ['clear', 'confirm'],
            done: function (value, date) {

            }
        });
    })

    function saveData() {
        $.ajax({
            url: "../Basis/SaveApprovesInfo",
            data: { datas: JSON.stringify(FormToJson("AddForm")) },
            dataType: "json",
            type: "POST",
            success: function (data) {
                if (data.Result) {
                    var id = $("input[ name='id']").val();
                    var msg = "信息修改成功";
                    if (id == "0" || id == "") {
                        msg = "信息添加成功";
                    }
                    layer.alert(msg, { icon: 6 }, function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    });
                } else {
                    layer.msg(data.Message);
                }
            }
        });
    }
</script>